﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="DisplayClient.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.Client.DisplayClient" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <fieldset>
        <legend>Fiche client</legend>
        
        <fieldset>
            <legend>Informations</legend>
            <table>
            <tr>
                <td>Nom : </td>
                <td>
                    <asp:Label ID="displayClientName" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Activité : </td>
                <td>
                    <asp:Label ID="displayClientActivity" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Téléphone:</td>
                <td><asp:Label ID="displayPhone" runat="server"/></td>
            </tr>
            <tr>
                <td>Adresse : </td>
                <td>
                    <asp:Literal ID="displayClientAdress" runat="server"></asp:Literal>
                </td>
            </tr>
        </table>
        </fieldset>
        
        <fieldset>
            <legend>Affaires</legend>
            <asp:EntityDataSource ID="DS_Businesses" runat="server" 
                ConnectionString="name=Model_GRC_TPEContainer" 
                DefaultContainerName="Model_GRC_TPEContainer" EnableFlattening="False" 
                EntitySetName="BusinessSet" EntityTypeFilter="Business" Include="Client">
            </asp:EntityDataSource>
            <asp:ListView ID="LV_Businesses" runat="server" DataKeyNames="Id" 
                DataSourceID="DS_Businesses" GroupItemCount="1">
                <AlternatingItemTemplate>
                    <td runat="server" style="background-color:#d4e3f3;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Client:</td>
                                <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Titre:</td>
                                <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Statut:</td>
                                <td><asp:Label ID="StateLabel" runat="server" Text='<%# Eval("State") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Montant:</td>
                                <td><asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Description:</td>
                                <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteCommunication_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditBusiness" runat="server" Text="Modifier" onclick="B_EditBusiness_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr>
                        </table>
                    </td>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                   
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table class="contentTable" runat="server" 
                        style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                        <tr>
                            <td>Aucune affaire en base.</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewBusiness" runat="server" OnClick="LB_NewBusiness_Click">Nouvelle affaire</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EmptyItemTemplate>
                    <td runat="server" />
                </EmptyItemTemplate>
                <GroupTemplate>
                    <tr ID="itemPlaceholderContainer" runat="server">
                        <td ID="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </GroupTemplate>
                <InsertItemTemplate>
                    
                </InsertItemTemplate>
                <ItemTemplate>
                    <td runat="server" style="background-color:#eaf3f9;color: #000000;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Client:</td>
                                <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Titre:</td>
                                <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Statut:</td>
                                <td><asp:Label ID="StateLabel" runat="server" Text='<%# Eval("State") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Montant:</td>
                                <td><asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Description:</td>
                                <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteCommunication_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditBusiness" runat="server" Text="Modifier" onclick="B_EditBusiness_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr>
                        </table>
                    </td>
                </ItemTemplate>
                <LayoutTemplate>
                    <table runat="server" class="contentTable">
                        <tr runat="server">
                            <td runat="server">
                                <table class="contentTable" ID="groupPlaceholderContainer" runat="server" border="1" 
                                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr ID="groupPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" 
                                style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                                <asp:DataPager ID="DataPager1" runat="server" PageSize="5">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageText="Premier" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" LastPageText="Dernier" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewBusiness" runat="server" OnClick="LB_NewBusiness_Click">Nouvelle affaire</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    
                </SelectedItemTemplate>
            </asp:ListView>
        </fieldset>

        <fieldset>
            <legend>Contacts</legend>
            <asp:EntityDataSource ID="DS_Contacts" runat="server" 
                ConnectionString="name=Model_GRC_TPEContainer" 
                DefaultContainerName="Model_GRC_TPEContainer" EntitySetName="ContactSet" 
                EntityTypeFilter="Contact">
            </asp:EntityDataSource>
            <asp:ListView ID="LV_Contacts" runat="server" DataKeyNames="Id" 
                DataSourceID="DS_Contacts" GroupItemCount="1">
                <AlternatingItemTemplate>
                    <td runat="server" style="background-color:#d4e3f3;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Prénom:</td>
                                <td><asp:Label ID="FirstnameLabel" runat="server" Text='<%# Eval("Firstname") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Nom:</td>
                                <td><asp:Label ID="LastnameLabel" runat="server" Text='<%# Eval("Lastname") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Téléphone:</td>
                                <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Phone") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">E-mail:</td>
                                <td><asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Fonction:</td>
                                <td><asp:Label ID="FunctionLabel" runat="server" Text='<%# Eval("Function") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteContact_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditContact" runat="server" Text="Modifier" onclick="B_EditContact_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr>
                        </table>
                    </td>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table class="contentTable" runat="server" 
                        style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                        <tr>
                            <td>
                                Aucun contact enregistré.</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewContact" runat="server" OnClick="LB_NewContact_Click">Nouveau contact</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EmptyItemTemplate>
                    <td runat="server" />
                </EmptyItemTemplate>
                <GroupTemplate>
                    <tr ID="itemPlaceholderContainer" runat="server">
                        <td ID="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </GroupTemplate>
                <InsertItemTemplate>
                    
                </InsertItemTemplate>
                <ItemTemplate>
                    <td runat="server" style="background-color:#eaf3f9;color: #000000;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Prénom:</td>
                                <td><asp:Label ID="FirstnameLabel" runat="server" Text='<%# Eval("Firstname") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Nom:</td>
                                <td><asp:Label ID="LastnameLabel" runat="server" Text='<%# Eval("Lastname") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Téléphone:</td>
                                <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Phone") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">E-mail:</td>
                                <td><asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Fonction:</td>
                                <td><asp:Label ID="FunctionLabel" runat="server" Text='<%# Eval("Function") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteContact_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditContact" runat="server" Text="Modifier" onclick="B_EditContact_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr>
                        </table>
                    </td>
                </ItemTemplate>
                <LayoutTemplate>
                    <table runat="server" class="contentTable">
                        <tr runat="server">
                            <td class="contentTable" runat="server">
                                <table class="contentTable" ID="groupPlaceholderContainer" runat="server" border="1" 
                                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr ID="groupPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" 
                                style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                                <asp:DataPager ID="DataPager1" runat="server" PageSize="5">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageText="Premier" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" LastPageText="Dernier" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewContact" runat="server" OnClick="LB_NewContact_Click">Nouveau contact</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <SelectedItemTemplate>
                </SelectedItemTemplate>
            </asp:ListView>
        </fieldset>

        <fieldset>
            <legend>Communications</legend>
            <asp:EntityDataSource ID="DS_Communications" runat="server" 
                ConnectionString="name=Model_GRC_TPEContainer" 
                DefaultContainerName="Model_GRC_TPEContainer" EnableFlattening="False" 
                EntitySetName="CommunicationSet" EntityTypeFilter="Communication" Include="User">
            </asp:EntityDataSource>
            <asp:ListView ID="LV_Communications" runat="server" DataKeyNames="Id" 
                DataSourceID="DS_Communications" GroupItemCount="1">
                <AlternatingItemTemplate>
                    <td runat="server" style="background-color:#d4e3f3;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Date:</td>
                                <td><asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Titre:</td>
                                <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Type:</td>
                                <td><asp:Literal ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Description:</td>
                                <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Utilisateur:</td>
                                <td><asp:Label ID="UserLabel" runat="server" Text='<%# Eval("User.Firstname") + " " + Eval("User.Lastname") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteBusiness_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditCommunication" runat="server" Text="Modifier" onclick="B_EditCommunication_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr>
                        </table>
                    </td>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table class="contentTable" runat="server" 
                        style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                        <tr>
                            <td>
                                Aucune communication en base.</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewCommunication" runat="server" OnClick="LB_NewCommunication_Click">Nouvelle communication</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EmptyItemTemplate>
                    <td runat="server" />
                </EmptyItemTemplate>
                <GroupTemplate>
                    <tr ID="itemPlaceholderContainer" runat="server">
                        <td ID="itemPlaceholder" runat="server">
                        </td>
                    </tr>
                </GroupTemplate>
                <InsertItemTemplate>
                    
                </InsertItemTemplate>
                <ItemTemplate>
                    <td runat="server" style="background-color:#eaf3f9;color: #000000;">
                        <table class="contentTable">
                            <tr>
                                <td class="td_left">Date:</td>
                                <td><asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Titre:</td>
                                <td><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Type:</td>
                                <td><asp:Literal ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Description:</td>
                                <td><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' /></td>
                            </tr>
                            <tr>
                                <td class="td_left">Utilisateur:</td>
                                <td><asp:Label ID="UserLabel" runat="server" Text='<%# Eval("User.Firstname") + " " + Eval("User.Lastname") %>' /></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_DeleteBusiness_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                                <td><asp:Button ID="B_EditCommunication" runat="server" Text="Modifier" onclick="B_EditCommunication_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                            </tr
                        </table>
                    </td>
                </ItemTemplate>
                <LayoutTemplate>
                    <table runat="server" class="contentTable">
                        <tr runat="server">
                            <td runat="server">
                                <table class="contentTable" ID="groupPlaceholderContainer" runat="server" border="1" 
                                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr ID="groupPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" 
                                style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                                <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageText="Premier" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" LastPageText="Dernier" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:LinkButton ID="LB_NewCommunication" runat="server" OnClick="LB_NewCommunication_Click">Nouvelle communication</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    
                </SelectedItemTemplate>
            </asp:ListView>
        </fieldset>
    </fieldset>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" runat="server">
</asp:Content>
